<template>
    <div class="more-dynamic">
        <el-card :style="{height: this.$Global.screeHeight - this.$Global.headerHeight - this.$Global.footerHeight+'px'}">
            <ul>
                <li v-for="item in dynamics">
                    <el-link @click="toDynamic(item.id)">{{item.title}}</el-link>
                    <label style="float: right">{{item.createDate}}</label>
                </li>
            </ul>
        </el-card>
    </div>
</template>

<script>
export default {
    data() {
        return {
            dynamics: []
        };
    },
    methods: {
        getDynamics() {
            this.$http("/companyDynamic/getAll").then(response => {
                this.dynamics = response.data;
            });
        },
        toDynamic(id) {
            this.$router
                .push({ path: "/companyDynamic", query: { id: id } })
                .catch(err => err);
        }
    },
    mounted() {
        this.getDynamics();
    }
};
</script>

<style>
.more-dynamic .el-card {
    width: 600px;
    margin: 0 auto;
}
</style>